package com.wuzihao.disk.file.service;

import com.wuzihao.disk.file.entity.SearchFileEntity;
import com.wuzihao.disk.mybatis.entity.PtFileEntity;
import com.wuzihao.disk.mybatis.flexigrid.PagingEntity;
import com.wuzihao.disk.mybatis.flexigrid.TblResponseEntity;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

public interface FileService {

    /**
     * 查询文件列表
     * @return
     */
    List<PtFileEntity> queryFileList();

    /**
     * 分页查询
     * @param entity
     * @param paging
     * @return
     */
    TblResponseEntity<PtFileEntity> queryFileInfoListByPage(SearchFileEntity entity, PagingEntity paging);

    boolean uploadFiles(MultipartFile[] files, String targetDir);

    /**
     * 保存文件信息列表
     * @param ptFileEntityList 文件信息列表
     */
    void saveFileInfo(List<PtFileEntity> ptFileEntityList);

    /**
     * 根据文件id查询文件信息
     * @param fileUuid
     * @return
     */
    PtFileEntity queryFileInfoById(String fileUuid);

    List<Map<String, Object>> queryDirectoryTree();

    void copyFile(String fileUuid, String targetDir);

    String queryFileNameByUuid(String fileUuid);

    /**
     * 修改文件信息
     * @param entity
     */
    void modifyFileInfoById(PtFileEntity entity);
}
